.class public Lcn/cheln/explorer/beans/ApkInfo;
.super Lcn/cheln/explorer/beans/FileInfo;


# static fields
.field public static DISPLAY_UNKNOWN:Ljava/lang/String;

.field public static DISPLAY_VERSION_CODE:Ljava/lang/String;

.field public static VERSION_INTALLED:Ljava/lang/String;

.field public static VERSION_UNINTALLED:Ljava/lang/String;

.field public static VERSION_UPDATETODATE:Ljava/lang/String;

.field public static VERSION_UPGRADE:Ljava/lang/String;


# instance fields
.field public isBuilt:Z

.field public packageName:Ljava/lang/String;

.field public versionCondition:Ljava/lang/String;

.field public versionName:Ljava/lang/String;

.field public versionNameStr:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lcn/cheln/explorer/beans/FileInfo;-><init>()V

    sget-object v0, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_VERSION_CODE:Ljava/lang/String;

    iput-object v0, p0, Lcn/cheln/explorer/beans/ApkInfo;->versionNameStr:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Ljava/io/File;Landroid/content/Context;)V
    .locals 1

    invoke-direct {p0, p1, p2}, Lcn/cheln/explorer/beans/FileInfo;-><init>(Ljava/io/File;Landroid/content/Context;)V

    sget-object v0, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_VERSION_CODE:Ljava/lang/String;

    iput-object v0, p0, Lcn/cheln/explorer/beans/ApkInfo;->versionNameStr:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;)V
    .locals 2

    invoke-direct {p0}, Lcn/cheln/explorer/beans/FileInfo;-><init>()V

    sget-object v0, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_VERSION_CODE:Ljava/lang/String;

    iput-object v0, p0, Lcn/cheln/explorer/beans/ApkInfo;->versionNameStr:Ljava/lang/String;

    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    iput-object v0, p0, Lcn/cheln/explorer/beans/FileInfo;->leng:Ljava/lang/Long;

    iget-object v0, p0, Lcn/cheln/explorer/beans/FileInfo;->leng:Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v0

    long-to-float v0, v0

    invoke-static {v0}, Lcn/cheln/support/app/a;->a(F)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcn/cheln/explorer/beans/FileInfo;->sizeText:Ljava/lang/String;

    invoke-static {p1}, Lcn/cheln/support/app/a;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcn/cheln/explorer/beans/FileInfo;->name:Ljava/lang/String;

    return-void
.end method

.method public static a(Landroid/content/Context;)V
    .locals 1

    const v0, 0x7f05007a

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcn/cheln/explorer/beans/ApkInfo;->VERSION_UNINTALLED:Ljava/lang/String;

    const v0, 0x7f050079

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcn/cheln/explorer/beans/ApkInfo;->VERSION_UPDATETODATE:Ljava/lang/String;

    const v0, 0x7f05007b

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcn/cheln/explorer/beans/ApkInfo;->VERSION_UPGRADE:Ljava/lang/String;

    const v0, 0x7f05007c

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcn/cheln/explorer/beans/ApkInfo;->VERSION_INTALLED:Ljava/lang/String;

    const v0, 0x7f05007d

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_VERSION_CODE:Ljava/lang/String;

    const v0, 0x7f05007f

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_UNKNOWN:Ljava/lang/String;

    return-void
.end method

.method private b(Ljava/io/File;)Z
    .locals 8

    const/4 v7, 0x0

    const/4 v6, 0x1

    iget-boolean v0, p0, Lcn/cheln/explorer/beans/ApkInfo;->isBuilt:Z

    if-eqz v0, :cond_0

    move v0, v6

    :goto_0
    return v0

    :cond_0
    iput-boolean v6, p0, Lcn/cheln/explorer/beans/ApkInfo;->isBuilt:Z

    const-string v0, "android.content.pm.PackageParser"

    :try_start_0
    invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    const/4 v1, 0x1

    new-array v1, v1, [Ljava/lang/Class;

    const/4 v2, 0x0

    const-class v3, Ljava/lang/String;

    aput-object v3, v1, v2

    invoke-virtual {v0, v1}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;

    move-result-object v1

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {v1, v2}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    new-instance v2, Landroid/util/DisplayMetrics;

    invoke-direct {v2}, Landroid/util/DisplayMetrics;-><init>()V

    invoke-virtual {v2}, Landroid/util/DisplayMetrics;->setToDefaults()V

    const/4 v3, 0x4

    new-array v3, v3, [Ljava/lang/Class;

    const/4 v4, 0x0

    const-class v5, Ljava/io/File;

    aput-object v5, v3, v4

    const/4 v4, 0x1

    const-class v5, Ljava/lang/String;

    aput-object v5, v3, v4

    const/4 v4, 0x2

    const-class v5, Landroid/util/DisplayMetrics;

    aput-object v5, v3, v4

    const/4 v4, 0x3

    sget-object v5, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;

    aput-object v5, v3, v4

    const-string v4, "parsePackage"

    invoke-virtual {v0, v4, v3}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v0

    const/4 v3, 0x4

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object p1, v3, v4

    const/4 v4, 0x1

    invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x2

    aput-object v2, v3, v4

    const/4 v2, 0x3

    const/4 v4, 0x0

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v3, v2

    invoke-virtual {v0, v1, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    const-string v2, "packageName"

    invoke-virtual {v1, v2}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcn/cheln/explorer/beans/ApkInfo;->packageName:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    const-string v2, "mVersionName"

    invoke-virtual {v1, v2}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcn/cheln/explorer/beans/ApkInfo;->versionName:Ljava/lang/String;

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v1, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_VERSION_CODE:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcn/cheln/explorer/beans/ApkInfo;->versionName:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcn/cheln/explorer/beans/ApkInfo;->versionNameStr:Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move v0, v6

    goto/16 :goto_0

    :catch_0
    move-exception v0

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v1, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_VERSION_CODE:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    sget-object v1, Lcn/cheln/explorer/beans/ApkInfo;->DISPLAY_UNKNOWN:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcn/cheln/explorer/beans/ApkInfo;->versionNameStr:Ljava/lang/String;

    move v0, v7

    goto/16 :goto_0
.end method


# virtual methods
.method public final a()Z
    .locals 2

    iget-object v0, p0, Lcn/cheln/explorer/beans/FileInfo;->path:Ljava/lang/String;

    if-nez v0, :cond_0

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "should initialize path in ApkInfo"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_0
    new-instance v0, Ljava/io/File;

    iget-object v1, p0, Lcn/cheln/explorer/beans/FileInfo;->path:Ljava/lang/String;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-direct {p0, v0}, Lcn/cheln/explorer/beans/ApkInfo;->b(Ljava/io/File;)Z

    move-result v0

    return v0
.end method

.method public equals(Ljava/lang/Object;)Z
    .locals 2

    const/4 v1, 0x0

    if-nez p1, :cond_0

    move v0, v1

    :goto_0
    return v0

    :cond_0
    instance-of v0, p1, Lcn/cheln/explorer/beans/FileInfo;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcn/cheln/explorer/beans/FileInfo;->path:Ljava/lang/String;

    check-cast p1, Lcn/cheln/explorer/beans/FileInfo;

    iget-object v1, p1, Lcn/cheln/explorer/beans/FileInfo;->path:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    goto :goto_0

    :cond_1
    move v0, v1

    goto :goto_0
.end method
